<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link rel="stylesheet" href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css">
		<style type="text/css">
			body{background: ivory;height: 662px;}
			th {white-space: nowrap;}
			.container{margin-top: 9%;}
			#subBtn{margin-top: 2%;margin-left: 29%;}
			#regBtn{margin-top: -15%;margin-left: 45%;}
			#forgetPassword{float: right;margin-top: 4.4%;margin-right: 17.5%;}
			#panel{margin: 3%;height: 340px;width: 400px;background-color: rgba(0,0,0,0.3);border-radius: 5px;}
			#canvas{margin-bottom: 200px;margin-left: 29%;}
			#valiCode{width: 90px;}
			#banner {background-image: url(img/banner.jpg);}
		    .container {background: ivory;height: 662px;}
		    #logo {margin-left: 10%;width: 8%;height: 8%;}
		    #siteName {margin-top: 60%;margin-left: 3%;font-family: "楷体";font-size: 30px;}
			.tab-pane {margin: 7%;}
      		#subtitle {margin-top: -3%;margin-left: 22%;color: white;font-family: "楷体";}
			#pic{margin-top: 3%;}
			#keepPassword{margin-left: 27%;}
			#img1{margin-top: -15%;margin-left: 30%;}
		</style>
	</head>

	<body>
		<div class="container" style="margin:0;width:100%">
			<div class="row clearfix" id="banner">
				<div class="col-md-8 column">
					<img src="img/t14.png" id="logo" />
					<nobr id="siteName" style="color: steelblue;">寻一路知己</nobr>
					<p id="subtitle">公共汽车管理系统</p>
				</div>
				<div class="col-md-4 column">
					<ul class="breadcrumb">
						<li>
							<a href="${pageContext.request.contextPath}/register.jsp">注册</a>
						</li>
						<li>
							<a href="${pageContext.request.contextPath}/login.jsp">登录</a>
						</li>
						<li>
							<a href="#">帮助中心</a>
						</li>
						<li>
							<a href="#">退出登录</a>
						</li>
					</ul>
				</div>
			</div>
			<div class="row clearfix">
				<div class="col-md-7 column" id="pic">
					<div class="carousel slide" id="carousel-603745">
						<ol class="carousel-indicators">
							<li class="active" data-slide-to="0" data-target="#carousel-603745">
							</li>
							<li data-slide-to="1" data-target="#carousel-603745">
							</li>
							<li data-slide-to="2" data-target="#carousel-603745">
							</li>
						</ol>
						<div class="carousel-inner">
							<div class="item active">
								<img alt="" src="img/1.png" />
							</div>
							<div class="item">
								<img alt="" src="img/1.png" />
								
							</div>
							<div class="item">
								<img alt="" src="img/1.png" />
							</div>
						</div>
						<a class="left carousel-control" href="#carousel-603745" data-slide="prev"><span class="glyphicon glyphicon-chevron-left"></span></a>
						<a class="right carousel-control" href="#carousel-603745" data-slide="next"><span class="glyphicon glyphicon-chevron-right"></span></a>
					</div>
				</div>
				<div class="col-md-1 column">
				</div>
				
				<div class="col-md-4 column" id="panel">
					<%
						 Cookie[] cookies = request.getCookies();
						String username ="";
						String password ="";
						if(cookies != null)
						{
							for(Cookie cookie : cookies)
							{
								if(cookie.getName().equals("username"))
								{
									username = cookie.getValue();
								}
								if(cookie.getName().equals("password"))
								{
									password = cookie.getValue();
								}
							}
						}
						
						if("" != password){
							request.getRequestDispatcher("/WEB-INF/views/index.jsp");
						}
						
					%>
					<form action="${pageContext.request.contextPath}/user_login.action" method="post">
						<div class="form-group">
							<label for="exampleInputEmail1">用户名</label>
							<input type="text" class="form-control" id="exampleInputUsername1" name="username" value=""/>
						</div>
						<div class="form-group">
							<label for="exampleInputPassword1">密码</label>
							<input type="password" class="form-control" id="exampleInputPassword1" name="password" />
						</div>
						<div class="form-group">
							<label for="exampleInputPassword1">验证码</label>
							<input type="text" class="form-control" id="valiCode" name="valiCode"/>
							<img alt="验证码" src="code" id="img1"> &nbsp;&nbsp;
							<a href="javascript:;" id="a1">看不清换一张</a>
						</div>
						<input type="checkbox" name="keepPassword" id="keepPassword" value="keepPassword" />记住用户名
						<input type="checkbox" name="autoLogin" id="autoLogin" value="autoLogin" />自动登录
						</br><input type="submit" class="btn btn-default" value="登录" id="subBtn"/>
						</form>
						<a href="register.jsp"><button id="regBtn" class="btn btn-default">注册</button></a>
						<a href="register.html" id="forgetPassword">忘记密码</a>	
					</div> 	
				</div>
			</div>
		</div>

		<script src="http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script>
		<script src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>
		<script type="text/javascript">
			$(function(){
				$("#a1").click(function(){
					var img = document.getElementById("img1");
					img.src = 'code?' + Math.random();
				})
			});
		</script>
	</body>
</html>